package com.java.base.javabase.thread;

/**
 * @ClassName FirstThread
 * @Author FangShanShan
 * @Description 多线程测试
 * @Date 2020/4/27 15:57
 */
public class FirstThread extends Thread {

    private Integer count = 0;

    private String name;


    @Override
    public void run() {
        name = Thread.currentThread().getName();
        System.out.println(name + " -- START UP ! -- " + count);
        count++;
        try {
            long time = 2000;
            sleep(time);
            System.out.println(name + " -- 【睡了" + time + "】起来了!");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(name + " -- CLOSE ! -- " + count);

    }


}